import { HashMap } from "../../api/struct/HashMap";
import { CDDropGroup } from "../excel/CDDropGroup";



/**
 * 扩展-掉落组
 */
export abstract class CEDropGroup {

    /**数据 */
    private static readonly groupTeam = new HashMap<number, number[]>();


    /**初始化 */
    public static init(): void {
        const vs = CDDropGroup.datas.getValues();
        for (let i = 0, len = vs.length; i < len; i++) {
            const groupID = vs[i].dropGroupid;
            if (groupID === 0) {
                continue;
            }
            let teamList = this.groupTeam.get(groupID);
            if (!teamList) {
                teamList = [];
                this.groupTeam.put(groupID, teamList);
            }
            teamList.push(vs[i].id);
        }
    }


    /** 获取数据*/
    public static getTeamList(groupID: number): number[] {
        return this.groupTeam ? this.groupTeam.get(groupID) : null;
    }
}